home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Converters / Convert_PICT / Source / CommentedPSCode / makeUncommented < prev    next >
Text File  |  1995-06-12  |  1KB  |  29 lines

  1. #!    /bin/csh
  2.  
  3. #    Run this from within the CommentedPSCode directory, or it won't work quite right.
  4. #
  5. #    This quick hack simply takes each of the files of PS code, and runs them through a
  6. #    simple AWK script which removes blank lines and any line made up of only a PS
  7. #    comment (with optional leading space) and dumps the results into UncommentedPSCode.
  8. #    This drastically reduces the size of the files (also drastically increassing their
  9. #    unclarity).  A better script might get rid of those PS comments that come at the end
  10. #    of a line, after some PS code.  An ambitious one might try to identify variables and
  11. #    shorten their names.  Of course, one can also reduce indenting, move {}'s and defs onto
  12. #    other lines.  Etc.  I provide this only as a minimal service, for I shan't use it at all.
  13. #    if you improve upon this script, I'd be happy to recieve a copy, though.
  14. #                            David John Burrowes
  15.  
  16. set DestCode = ../UncommentedPSCode
  17.  
  18. if  (! -d $DestCode ) then
  19.     echo "Creating Uncommented code folder ($DestCode)"
  20.     mkdir $DestCode
  21.     chmod 777 $DestCode
  22. endif
  23.  
  24. echo "Copying PS code files (while removing most comments) to UncommentedPSCode."
  25. foreach psfile (Arcs Bitmaps Comments Common Lines Miscellaneous Ovals Patterns Colors Polygons Text Regions Rectangles RoundRectangles)
  26.     echo "    Doing $psfile"
  27.     awk   '/^$/ {next} /^%BEGIN/ {print $0} /^%END/ {print $0} /^[ \t]*%/ {next} {print $0}'  $psfile > ../UncommentedPSCode/$psfile
  28. end
  29.